<template>
    <van-nav-bar title="首页" />
    <van-search v-model="value" shape="round" placeholder="请输入搜索关键词" @click="ssk"/>
    <lbt></lbt>
    <van-grid :column-num="4">
        <van-grid-item v-for="item in dhdata" :icon="item.image_src" :text="item.name" />
    </van-grid>
    <div v-for="item in floordata">
        <img style="width:100%;" :src="item.floor_title.image_src" alt="">
        <div v-for="items in item.product_list" style="float:left; margin: 2px;" >
            <img style="width: 120px;; height: 120px;":src="items.image_src" alt="">
        </div>
    </div>
</template>

<script setup>
import { useRouter } from 'vue-router';
const router=new useRouter()
import lbt from '@/components/lbt.vue'
import { catitemsApi,floordataApi } from '@/api/api'
import { ref } from 'vue';
let dhdata = ref([])
catitemsApi().then(res => {
    console.log('导航数据', res);
    dhdata.value = res.data.message
})

let floordata=ref([])
floordataApi().then(res=>{
    console.log('楼层数据',res);
    floordata=res.data.message
})

const ssk=()=>{
    router.push('/sousuo')
}
</script>

<style lang="scss" scoped></style>